<template>
  
    <router-view/>

</template>

<script>
export default {
  name: 'App',
  watch: {
    '$route.path': function(newVal, oldVal){
      // let arr  = ['/dashboard','/cate','/admin','/info','/article'];
      let obj = {
        '/dashboard':'系统首页',
        '/cate':'分类管理',
        '/admin':'管理员管理',
        '/info':'博客信息管理',
        '/article':'文章管理'
      }
      if(obj[newVal]){ 
        for(let i=0;i<this.$store.state.tagsList.length;i++){
            if(this.$store.state.tagsList[i].path === newVal){
                return;
            }
        }
        this.$store.commit('addTag', {
          title: obj[newVal],
          path: newVal
        })
      }
    }
  }
}
</script>

<style>
html,
body
{
  height: 100%;
  margin:0;
  padding: 0;

}
</style>
